<?php echo $header; ?>
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 style="background-image: url('view/image/review.png');"><?php echo $heading_title; ?></h1>
    <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo $button_save; ?></span></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><span><?php echo $button_cancel; ?></span></a></div>
  </div>
  <div class="content">
  <div id="tabs" class="htabs">
  <a tab="#tab_general"><?php echo $tab_general; ?></a>
  </div>
    
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
    <input type="hidden" name="menu_id" value="<?php echo $menu_id; ?>" id="menu_id" />
      <table class="form">
        <tr>
          <td><span class="required">*</span> <?php echo $entry_title; ?></td>
          <td><input type="text" name="title" value="<?php echo $title; ?>" />
            <?php if ($error_title) { ?>
            <span class="error"><?php echo $error_title; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_add_date; ?></td>
          <td><input type="text" id="add_date" name="add_date" value="<?php echo $add_date; ?>" />
            <?php if ($error_add_date) { ?>
            <span class="error"><?php echo $error_add_date; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
        	<td><?php echo $entry_summary; ?></td>
        	<td><textarea name="summary" cols="40" rows="5"><?php echo isset($summary) ? $summary : ''; ?></textarea></td>
        </tr>
        <tr>
		    <td style="text-align: left;"><?php echo $entry_detail; ?></td>
		    <td class="left"><textarea name="detail" id="detail"><?php echo isset($detail) ? $detail : ''; ?></textarea></td>
	    </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_ordering; ?></td>
          <td><input type="text" name="ordering" value="<?php echo $ordering; ?>" />
            <?php if ($error_ordering) { ?>
            <span class="error"><?php echo $error_ordering; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><?php echo $entry_image; ?></td>
          <td>
          	<img src="<?php echo $preview; ?>" alt="" id="preview" class="image" />
          	<input type="file" name="image" value="<?php echo $image; ?>" />
          </td>
        </tr>
        
      </table>
    </form>
  </div>
</div>
<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script>
<script type="text/javascript"><!--
CKEDITOR.replace('detail', {
	filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'
});
//--></script>
<script language='JavaScript' type="text/javascript">
//This happens when the page is loaded
$(function() {
	$('#add_date').datepicker({ 
		showMonthAfterYear: true,
		changeMonth: true,
		changeYear: true,
		monthNamesShort:['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
		prevText: '上一月',    
		nextText: '下一月',  
		dateFormat: 'yy-mm-dd',    
    	monthNames:['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
    	dayNamesMin: ['日','一','二','三','四','五','六']    	
    }); 
});
</script>
<?php echo $footer; ?>